FROM golang:1.17 AS build
WORKDIR /httpserver/
ENV GO111MODULE=off \
    CGO_ENABLED=0 \
    GOOS=linux \
    GOARCH=amd64
COPY . .
RUN go build -o httpserver main.go

FROM busybox
COPY --from=build /httpserver/httpserver /
EXPOSE 8080
ENTRYPOINT ["/httpserver"]